<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>地址探测</title>
    <script type="text/javascript" src="http://www.google.cn/jsapi?key=ABQIAAAAPTwhF4vlVXrO7ZGOjA9sOxTqQ5WtUwE0C8FR1hRk-yj3qFOmhhR6esbxCerNyfzApAoTJGfOHzcKCQ&hl=zh-CN&gl=cn&sensor=false"></script>
    <script type="text/javascript">
    google.load("maps", "2.x", {base_domain: "ditu.google.cn", language: "zh-CN"});
    function initialize() {
      if (GBrowserIsCompatible()) {
        // Initialize default values
        var zoom = 5;
        var latlng = new google.maps.LatLng(37.4419, 116.397);

        // If ClientLocation was filled in by the loader, use that info instead
        if (google.loader.ClientLocation) {
          zoom = 13;
          alert('你的IP地址属于：' + google.loader.ClientLocation.address.city);
          latlng = new google.maps.LatLng(google.loader.ClientLocation.latitude,                     
                                          google.loader.ClientLocation.longitude);
        }
        var map = new google.maps.Map2(document.getElementById("map_canvas"));
        map.setCenter(latlng, zoom);
      }
      google.setOnLoadCallback(initialize);
    }

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 500px; height: 300px"></div>
  </body>
</html>
